-- GENERATED SPELL FOR [Crimson Sorcerer] --


function spell0_10422(pUnit, Event) --@Arcane Bolt,n/a--
pUnit:FullCastSpellOnTarget(15230,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_10422', 1000, 1)
end

function spell1_10422(pUnit, Event) --@Arcane Might,n/a--
pUnit:FullCastSpellOnTarget(17150,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_10422', 589, 1)
end

function spell2_10422(pUnit, Event) --@Fire Blast,n/a--
pUnit:FullCastSpellOnTarget(14145,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_10422', 692, 1)
end

function spell3_10422(pUnit, Event) --@Frost Armor,Self--
pUnit:FullCastSpellOnTarget(12544,pUnit)
pUnit:RegisterEvent('Sorts_10422', 0, 1)
end

function spell4_10422(pUnit, Event) --@Polymorph,n/a--
pUnit:FullCastSpellOnTarget(13323,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_10422', 9500, 1)
end

function Sorts_10422(pUnit, Event)
local choix_sorts_10422 = math.random(0, 4)
if choix_sorts_10422 == 0 then
pUnit:RegisterEvent('spell0_10422', 1, 1)
end
if choix_sorts_10422 == 1 then
pUnit:RegisterEvent('spell1_10422', 1, 1)
end
if choix_sorts_10422 == 2 then
pUnit:RegisterEvent('spell2_10422', 1, 1)
end
if choix_sorts_10422 == 3 then
pUnit:RegisterEvent('spell3_10422', 1, 1)
end
if choix_sorts_10422 == 4 then
pUnit:RegisterEvent('spell4_10422', 1, 1)
end
end

function mob10422_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_10422', math.random(1500, 3000), 1)
end

function mob10422_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob10422_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob10422_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(10422, 1, 'mob10422_Action')
RegisterUnitEvent(10422, 2, 'mob10422_Leave')
RegisterUnitEvent(10422, 3, 'mob10422_Kill')
RegisterUnitEvent(10422, 4, 'mob10422_Die')
